<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
<script type="text/javascript">
function m_video(){
	var id=$("#ids").val();
	var sid=$("#sid").val();
	var vodurl=$("#videourl").val();
	if(vodurl!=''){
	    $('#videourl').val('采集中，请稍候……');
		$.ajax({
			type: 'get',
			cache: false,
			dataType: 'json',
			url: "<?=site_url('vod/admin/vod/caiji')?>?ac=go&vodurl="+encodeURIComponent(vodurl),
			timeout: 3000, 
			success:function(row){
				if(row['error']=='no'){
					   $('#videourl').val(vodurl);
				       cscms.layer.msg('抱歉，没有采集到视频地址~!',{icon:2});
				}else{
				       if(sid==2){
				            var downurl=parent.$("#m_downurl"+id).val();
					        if(downurl!='') downurl+="\n";
				            parent.$("#m_downurl"+id).val(downurl+row['url']);
					   }else{
				            var playurl=parent.$("#m_playurl"+id).val();
					        if(playurl!='') playurl+="\n";
				            parent.$("#m_playurl"+id).val(playurl+row['url']);
					        parent.$("#m_playfrom"+id).val(row['laiy']);
					   }
					   if($("#nameid").is(":checked")){
					     	parent.$("#name").val(row['name']);  
					   }
					   if($("#picid").is(":checked")){
					     	parent.$("#pic").val(row['pic']);  
					   }
					   	var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
				}
			}
		});

	}else{
        alert('抱歉，采集地址不能为空~!');
	}

}
</script>
</head>
<body id="common">
	<blockquote class="layui-elem-quote">粘贴播放页面地址(支持优酷、酷6、土豆、搜狐、新浪、6房间、QQ、奇艺、PPS、乐视、56、音悦台)地址</blockquote>
	<form class="layui-form layui-form-pane" action="javascript:;" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">采集地址</label>
            <div class="layui-input-block">
                <input type="text" id='videourl' class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">同时更新</label>
            <div class="layui-input-block">
                <input type='checkbox' id='nameid' value='1' title="名称" <?=$check?> />
				<input type='checkbox' id='picid' value='1' title="图片" <?=$check?> />
				<input type='checkbox' id='laiyid' value='1' title="来源" checked />
            </div>
        </div>
        <input id="ids" type="hidden" value="<?=$id?>">
		<input id="sid" type="hidden" value="<?=$sid?>">
        <div class="layui-form-item">
            <div class="layui-input-block center">
                <button class="layui-btn" onclick="m_video()">提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <script type="text/javascript">
    	cscms.init();
    </script>
</body>
</html>
